<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
        //权限管理
        $this->app
            ->when(\App\Http\Controllers\Admin\PermissionController::class)
            ->needs(\App\Services\Interfaces\RepoServiceInterface::class)
            ->give(\App\Services\Repo\PermissionRepo::class);

        //角色管理
        $this->app
            ->when(\App\Http\Controllers\Admin\RoleController::class)
            ->needs(\App\Services\Interfaces\RepoServiceInterface::class)
            ->give(\App\Services\Repo\RoleRepo::class);

        //管理员管理
        $this->app
            ->when(\App\Http\Controllers\Admin\UserController::class)
            ->needs(\App\Services\Interfaces\RepoServiceInterface::class)
            ->give(\App\Services\Repo\UserRepo::class);
    }
}
